package com.xindong.paking.entity;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;


/**
 * @Author jielun
 * @Date 2022/12/28 19:50
 * @Version 1.0
 */
/*文件上传实体类*/
@Component
public class ConstantPropertiesUtil implements InitializingBean {

    @Value("${tencent.cos.file.region}")
//    @Value("ap-guangzhou")
    private String region;

    @Value("${tencent.cos.file.secretid}")
//    @Value("AKIDJTgqnW1HGzSh7TnywgAXmmY9VcT5RJ5g")
    private String secretId;

    @Value("${tencent.cos.file.secretkey}")
//    @Value("c0PbZJyYszsXyBE3e291d0940tjPo0yh")
    private String secretKey;

    @Value("${tencent.cos.file.bucketname}")
//    @Value("wdkt-1312366871")
    private String bucketName;

    public static String END_POINT;
    public static String ACCESS_KEY_ID;
    public static String ACCESS_KEY_SECRET;
    public static String BUCKET_NAME;

    @Override
    public void afterPropertiesSet() throws Exception {
        END_POINT = region;
        ACCESS_KEY_ID = secretId;
        ACCESS_KEY_SECRET = secretKey;
        BUCKET_NAME = bucketName;
    }

    @Override
    public String toString() {
        return "ConstantPropertiesUtil{" +
                "region='" + region + '\'' +
                ", secretId='" + secretId + '\'' +
                ", secretKey='" + secretKey + '\'' +
                ", bucketName='" + bucketName + '\'' +
                '}';
    }
}